<template>
  <ant-modal
    modalWidth="740"
    modalHeight="750"
    :visible="open"
    :modal-title="formTitle"
    :adjust-size="true"
    @cancel="cancel"
  >
    <a-form-model
      ref="form"
      :model="form"
      :rules="rules"
      slot="content"
      layout="vertical"
    >
      <a-row :gutter="32" style="width: 70%; margin-left: 15%">
        <a-col :span="12">
          <a-form-model-item label="姓名" prop="name">
            <a-input v-model="form.name" placeholder="请输入姓名" />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="所属企业" prop="deptId">
            <a-tree-select
              v-model="form.deptId"
              placeholder="请选择所属单位"
              :tree-data="deptOptions"
              tree-default-expand-all
              :replaceFields="{
                children: 'children',
                title: 'title',
                key: 'id',
                value: 'id',
              }"
              @change="onTreeChange"
              allow-clear
            >
            </a-tree-select>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="性别" prop="sex">
            <a-select
              placeholder="选择性别"
              v-model="form.sex"
              style="width: 100%"
              allow-clear
            >
              <a-select-option
                v-for="(d, index) in sexOptions"
                :key="index"
                :value="d.dictValue"
                >{{ d.dictLabel }}</a-select-option
              >
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="出生日期" prop="birthday">
            <a-input
              v-model="form.birthday"
              placeholder="请输入出生日期"
              allow-clear
            />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="联系方式" prop="phone">
            <a-input
              v-model="form.phone"
              placeholder="请输入联系方式"
              allow-clear
            />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="政治面貌" prop="mianmao">
            <a-input
              v-model="form.mianmao"
              placeholder="请输入政治面貌"
              allow-clear
            />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="职务" prop="zhiwu">
            <a-input
              v-model="form.zhiwu"
              placeholder="请输入职务"
              allow-clear
            />
          </a-form-model-item>
        </a-col>

        <a-col :span="12">
          <a-form-model-item label="籍贯" prop="jiguan">
            <a-input
              v-model="form.jiguan"
              placeholder="请输入籍贯"
              allow-clear
            />
          </a-form-model-item>
        </a-col>
      </a-row>
    </a-form-model>
    <template slot="footer">
      <a-button @click="cancel"> 取消 </a-button>
      <a-button type="primary" @click="submitForm"> 保存 </a-button>
    </template>
  </ant-modal>
</template>
<script>
import BizPersonInfoAddForm from "./BizPersonInfoForm";
export default {
  ...BizPersonInfoAddForm,
};
</script>
